//
// Created by xili on 2024/9/2 18:50.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    string strWithout3a3b(int a, int b) {
        string ans = "";
        while (a > b && b > 0) {
            ans += "aab";
            a -= 2;
            b--;
        }
        while (b > a && a > 0) {
            ans += "bba";
            a--;
            b -= 2;
        }
        while (a > 0 && b > 0) {
            ans += "ab";
            a--;
            b--;
        }
        while (a > 0) {
            ans += "a";
            a--;
        }
        while (b > 0) {
            ans += "b";
            b--;
        }
        return ans;
    }
};